package cn.lsc.feignclient;

import cn.lsc.domain.User;
import cn.lsc.feignclientfactory.UserFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/user")
@FeignClient(value="user-server", fallbackFactory = UserFeignClientFallbackFactory.class) // 指定需要调用的服务的应用名称
public interface UserFeignClient {
    @GetMapping("/findById/{id}")
    public User findById(@PathVariable("id")Long id);
}
